Skip to content

Conversation

@jlebon
Copy link
Member

@jlebon jlebon commented Mar 25, 2020

Instead of keeping separate the build metadata object and the build
directory, let's instead raise the visibility of sdk.LocalBuild, which
bundles those two things together already.

What I initially set out to solve was that cosa kola --build ID no
longer worked, because we weren't passing --cosa-build to kola
anymore. But even if we did, it's silly to have cosa kola dig into
build dirs to fetch the path to the meta.json when kola now knows
how to do that.

Concretely, this changes three things:

  1. we add a --cosa-workdir to allow specifying a cosa dir other than
    the current working dir.
  2. the --cosa-build argument is now a build ID, not a path to a
    meta.json.
  3. kola.CosaBuild is now a LocalBuild so that we also have access to
    the build directory everywhere.

@jlebon
Copy link
Member Author

jlebon commented Mar 25, 2020

Sorry, force-pushed a few times to tweak the commit message since there's one other key change I hadn't mentioned, which is:

the --cosa-build argument is now a build ID, not a path to a meta.json.

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep this is the direction I wanted to go too, but I didn't do it at the time because it would have been a conflict-fest with the testiso work.

src/cmd-kola Outdated
kolaargs.extend(['-p', 'qemu-unpriv'])

if args.build is not None:
kolaargs.extend(['--cosa-build', args.build])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just call the argument in kola --build? Then we could drop this right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this (and actually went one step further renaming --cosa-workdir to just --workdir) because yeah, kola now lives in cosa and we should reflect that.

Re. dropping the --build dir, I left that alone for now because the passthrough unknown args hack falls apart for switches which take values. It'll all be resolved anyway once cosa kola "$@" is just an exec kola "$@".

@cgwalters
Copy link
Member

Although...this is tricky because for IaaS cases we can support directly using a cosa.Meta and not a sdk.LocalBuild because we can just launch the AMI etc.

Copy link
Contributor

@arithx arithx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea makes sense to me, not sure if we have any CI machinery / pipelines that need to coordinate changes with this.

@jlebon
Copy link
Member Author

jlebon commented Mar 25, 2020

Although...this is tricky because for IaaS cases we can support directly using a cosa.Meta and not a sdk.LocalBuild because we can just launch the AMI etc.

Hmm, or maybe in that case we want to make --workdir support URLs?

@jlebon
Copy link
Member Author

jlebon commented Mar 25, 2020

With gofmt fixes! ⬆️

Copy link
Member

@cgwalters cgwalters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this makes sense I think, though maybe what we really want is something where we just have a

type Build struct {
  base string
  meta cosa.Meta 
}

And base could be a URL or a local file path - in the URL case we'd dynamically download the required artifacts.

Instead of keeping separate the build metadata object and the build
directory, let's instead raise the visibility of `sdk.LocalBuild`, which
bundles those two things together already.

What I initially set out to solve was that `cosa kola --build ID` no
longer worked, because we weren't passing `--cosa-build` to kola
anymore. But even if we did, it's silly to have `cosa kola` dig into
build dirs to fetch the path to the `meta.json` when `kola` now knows
how to do that.

Concretely, this changes three things:
1. we add a `--cosa-workdir` to allow specifying a cosa dir other than
   the current working dir.
2. the `--cosa-build` argument is now a build ID, not a path to a
   `meta.json`.
3. `kola.CosaBuild` is now a `LocalBuild` so that we also have access to
    the build directory everywhere.
@cgwalters
Copy link
Member

/lgtm

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: arithx, cgwalters, jlebon

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [arithx,cgwalters,jlebon]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit f851d61 into coreos:master Mar 25, 2020
@jlebon jlebon deleted the pr/cosa-kola branch July 6, 2020 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants